package com.soFun;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LangChain4jController {
    private final LangChain4jService langChain4jService;

    public LangChain4jController(LangChain4jService langChain4jService) {
        this.langChain4jService = langChain4jService;
    }

    @GetMapping("/generate")
    public String generate(@RequestParam String input) {
        // 调用服务类生成文本
        return langChain4jService.generate(input);
    }
}